import { ConfigManager } from "../../../com/gengine/resource/ConfigManager";
import { LevelGuideInfo } from "./info/LevelGuideInfo";
import { StringHelper } from "../../../com/gengine/utils/StringHelper";
type int = number;
//class LevelGuideConfig
    
    export  class LevelGuideConfig
    {
        constructor()
        {
            
            this._map = new Map<any, any> /* flash.utils.Dictionary */();
            if (LevelGuideConfig._instance != null) 
            {
                throw Error("LevelGuideConfig 单例");
            }
            this.init();
            return;
        }

        /* internal  */init(): void
        {
            var loc1=ConfigManager.instance.getJSONByFileName("t_level_guide.json");
            this.write(loc1);
            return;
        }

        /* internal  */write(arg1: Object): void
        {
            var loc1=null;
            var loc2=null;
            var loc3=0;
            var loc4=arg1;
            for(loc2 of loc4) 
            {
                loc1 = new LevelGuideInfo();
                loc1.guide = StringHelper.trim(loc2.guide);
                loc1.level = loc2.level;
                this._map[loc1.level] = loc1;
            }
            return;
        }

        public getLevelGuideInfoByLevel(arg1: int): LevelGuideInfo
        {
            return this._map[arg1];
        }

        public static get instance(): LevelGuideConfig
        {
            if (LevelGuideConfig._instance == null) 
            {
                LevelGuideConfig._instance = new LevelGuideConfig();
            }
            return LevelGuideConfig._instance;
        }

        /* internal */ /* var */_map: Map<any, any> /* flash.utils.Dictionary */;

        /* internal */ static /* var */_instance: LevelGuideConfig;
    }
